<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>菜单树</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="菜单树">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="${CONTEXT_PATH}/common/tree/treeCss.css">
	<script type="text/javascript" src="${CONTEXT_PATH}/common/tree/jquery.simple.tree.js"></script>

	<style type="text/css">
	.simpleTree .root
	{
		margin-left:0px;
		height:30px;
		background: url(${CONTEXT_PATH}/images/common/leftMenuTitle.gif) no-repeat 0 0 #ffffff;
	}
	</style>

	<script type="text/javascript">
	var simpleTreeCollection;
	$(document).ready(function(){
		//初始化高度
		//var h = $('#menuTb').height() - 5;
		//$('#treeDiv').height(h);
		simpleTreeCollection = $('#simpleTree').simpleTree({
			drag:false,
			docToFolderConvert:true,
			afterClick:function(node){
				var url = node.attr('url');
				if(url != null && '' != url.Trim() && url != 'null')
				{
					var mainFrame = self.parent.frames['mainFrame'];
					var sign = '?';
					if(url.indexOf('?') > -1)
					{
						sign = '&';
					}
					url += sign + 'kindergartenId=' + getTopKg();
					mainFrame.location.href = '${CONTEXT_PATH}/' + url;
				}
			}
		});
		
		initWidthHeight();
	});
	
	function initWidthHeight()
	{
		var menuTb = $('#menuTb');
		var treeDiv = $('#treeDiv');
		menuTb.width($(window).width() - 8);
		menuTb.height($(window).height() - 6);
		treeDiv.width($(window).width() - 8);
		treeDiv.height($(window).height() - 6);
		setTimeout('initWidthHeight()', 500);
	}
</script>

  </head>
  
  <body style="margin:-19px 0px -19px -18px">
  	<table id="menuTb" width="196px" height="100%" cellspacing="0" cellpadding="0" bordercolor="#2598E8" border="1">
		<tr>
			<td width="100%" height="100%" align="left" valign="top">
			  	<s:form name="frm" action="menuChange" namespace="/inner/common" method="post">
			  		<s:hidden name="mvo.menu.id" id="mid"></s:hidden>
			  		
			  		<div id="treeDiv" style="overflow:auto; width:100%;">
						<ul id="simpleTree" class="simpleTree">
							<li class="root" id="li0">
								
								<table style="font-size:20px; font-weight:bold; color:white" cellspacing="0" width="100%" height="30px">
									<tr>
										<td width="20px"></td>
										<td align="left" valign="middle">
											<s:property value="menu.menuName" />
										</td>
									</tr>
								</table>
								
								<s:property value="tree" escape="false"/>
							</li>
						</ul>
					</div>
			  	</s:form>
  			</td>
  		</tr>
  	</table>
  </body>
</html>
